using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Comteck.Domain.Entities;

namespace Comteck.Entities.Goods {
  /// <summary>
  /// 
  /// </summary>
  [Table("Product")]
  public class Product : Entity<int> {
    /// <summary>
    /// 商品id
    /// </summary>
    [Key]
    [Required, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public override int Id { get; set; }

    /// <summary>
    /// 商品编码
    /// </summary>
    [MaxLength(100)]
    public string Code { get; set; }

    /// <summary>
    /// 商品名称
    /// </summary>
    [Required, MaxLength(500)]
    public string Name { get; set; }

    /// <summary>
    /// 重量
    /// </summary>
    public decimal Weight { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(500)]
    public string Description { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; } = DateTime.Now;
  }
}
